import { IsArray, IsInt, IsOptional, Min } from 'class-validator';
import { PagingDto } from 'src/common/dto';

export class CreateCartOrderDto {
  @IsInt()
  addressId: number;

  @IsArray()
  cartIds: number[];
}

export class CreateDirectOrderDto {
  @IsInt()
  productId: number;

  @IsInt()
  @Min(1)
  quantity: number;

  @IsInt()
  addressId: number;
}

export class QueryOrder extends PagingDto {
  @IsOptional({ always: true })
  status?: 'unpaid' | 'paid' | 'cancelled' | 'shipped' | 'completed';
}
